package cn.jf.modules.system.service;

import cn.jf.modules.system.entity.SysAnnouncementSend;
import cn.jf.modules.system.mapper.SysAnnouncementSendMapper;
import cn.jf.modules.system.model.AnnouncementSendModel;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description: 用户通告阅读标记表
 * @Author: jeecg-boot
 * @Date:  2019-02-21
 * @Version: V1.0
 */
@Service(version = "1.0.0")
public class SysAnnouncementSendServiceImpl extends ServiceImpl<SysAnnouncementSendMapper, SysAnnouncementSend> implements ISysAnnouncementSendService {

	@Resource
	private SysAnnouncementSendMapper sysAnnouncementSendMapper;
	
	@Override
	public List<String> queryByUserId(String userId) {
		return sysAnnouncementSendMapper.queryByUserId(userId);
	}

	@Override
	public Page<AnnouncementSendModel> getMyAnnouncementSendPage(Page<AnnouncementSendModel> page,
																 AnnouncementSendModel announcementSendModel) {
		 return page.setRecords(sysAnnouncementSendMapper.getMyAnnouncementSendList(page,announcementSendModel));
	}

	@Override
	public Page<SysAnnouncementSend> getAnnouncementSendPage(Page<SysAnnouncementSend> page,String column,String order) {
		return page.setRecords(sysAnnouncementSendMapper.getAnnouncementSendList(page,column,order));
	}

	@Transactional
	@Override
	public void editByAnntIdAndUserId(SysAnnouncementSend sysAnnouncementSend) {
		sysAnnouncementSendMapper.editByAnntIdAndUserId(sysAnnouncementSend);
	}

	@Override
	public void insert(SysAnnouncementSend sysAnnouncementSend) {
		this.baseMapper.insert(sysAnnouncementSend);
	}

}
